package com.travelsky.airchina.boarding.dao.impl.hibernate;

import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.travelsky.airchina.boarding.dao.ProductWholePriceDAO;
import com.travelsky.airchina.boarding.domain.ProductWholePrice;


@Repository("productWholePriceDAO")
public class ProductWholePriceDAOImpl extends GenericDAOHibernate<ProductWholePrice, Long,ProductWholePriceDAO> implements ProductWholePriceDAO{
	@Autowired
	public ProductWholePriceDAOImpl(SessionFactory sessionFactory){
		this.setSessionFactory(sessionFactory);
	}
	public void deleteProductWholePriceByProductId(Long id) {
		String hql = "delete from ProductWholePrice where product.id = ? ";
		this.getHibernateTemplate().bulkUpdate(hql, id);
	}

}
